package com.cheng.io.print;

import java.io.IOException;
import java.io.InputStream;

/**
 * 标准流，将控制台作为数据源，JVM自动创建对象不需要手动关闭
 */
public class SystemInTest01 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;

        try {
            byte[] bytes = new byte[1024];
            // 将控制台作为数据源
            int readCount = inputStream.read(bytes);
            for (int i = 0; i < readCount; i++) {
                System.out.println(bytes[i]);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
